home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12318 < prev    next >
Encoding:
Text File  |  1996-08-05  |  950 b   |  41 lines

  1. Path: news.ust.hk!cs_billy
  2. From: cs_billy@ug.cs.ust.hk (Ng Ka Fai)
  3. Newsgroups: comp.lang.c++
  4. Subject: Question on writing DLL
  5. Date: 19 Mar 1996 14:24:05 GMT
  6. Organization: The Hong Kong University of Science and Technology
  7. Message-ID: <4img25$75t@ustsu10.ust.hk>
  8. NNTP-Posting-Host: csl2su12.cs.ust.hk
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11.  
  12. Hello all,
  13.  
  14. I am a new learner of DLL and I want to write a testing program on it and
  15. call the DLL from a macro of MS-word. However, error message display
  16. "Unable to open the specified library" ! What's wrong with it? I suspect
  17. that the DLL in Borland C++ (4.5) I written was wrong. 
  18. Could anyone help me? Please.
  19.  
  20. In macro
  21. --------
  22. Declare Function Abc Lib "c:\TEST.DLL" () As Integer
  23. Sub MAIN
  24. a = Abc()
  25. MsgBox Str$(a), "TEST"
  26. End Sub
  27.  
  28. In DLL
  29. ------
  30. #include <stdio.h>
  31. #include <windows.h>
  32.  
  33. int FAR _export Abc()
  34. {
  35.     int a=8;
  36.     return a;
  37. }
  38.  
  39. Please e-mail to cs_billy@uxmail.hkust.hk
  40. Thank you for your attention.
  41.